﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class manager_detail_nghiphep : System.Web.UI.Page
{

    NghiPhep n = new NghiPhep();
    Common c = new Common();
    User u = new User();

    protected void Page_Init(object sender, EventArgs e)
    {
       BindGrid();    
    }


    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["username"] != null && Session["groupid"].ToString() == "4")
            {
                
                BindGrid();
                lUsername.Text = Session["username"].ToString();
               // c.InitCombo(cbPhongBan, u.GroupID, u.PhongBanID);
            }
            else { Response.Redirect("../login.aspx"); }
        }
        else
            BindGrid();
    }
    protected void BindGrid()
    {
        if (Session["groupid"]!=null)
        {

            n.Tong_Hop_Nghi_Phep(gdNghiPhep);

        
        }
        else Response.Redirect("../login.aspx");

    }
    protected void cbPhongBan_SelectedIndexChanged(object sender, EventArgs e)
    {        
        BindGrid();
    }
    protected void lnkLogout_Click(object sender, EventArgs e)
    {
        Session.Clear();
        Response.Redirect("../login.aspx");
    }
}
